import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/shop/label/list',
    method: 'get',
    params
  })
}


export function apiAdd(params) {
  return request({
    url: '/shop/label',
    method: 'POST',
    data: {
      name: params.name,
      recommend: params.recommend
    }
  })
}

export function apiUpdate(params) {
  return request({
    url: '/shop/label',
    method: 'POST',
    data: {
      id: params.id,
      name: params.name,
      recommend: params.recommend
    }
  })
}

export function apiDelete(id) {
  return request({
    url: '/shop/label/remove',
    method: 'POST',
    params: {
      id: id
    }
  })
}

export function apiDeleteRelation(id) {
  return request({
    url: '/shop/labelGoods/remove',
    method: 'POST',
    params: {
      id: id
    }
  })
}



export function getUser(id) {
  return request({
    url: '/shop/user/' + id,
    method: 'get'
  })
}

export function getUserInfo(id) {
  return request({
    url: '/shop/user/info/' + id,
    method: 'get'
  })
}

export function getAllTags() {
  return request({
    url: '/shop/label/getAll',
    method: 'get'
  })
}